<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title>event事件测试-阻止冒泡</title>
	<script type="text/javascript" src="../js/base.js"></script>
	<style>
		#div1,#div2{width:200px;height:200px; border:1px solid #000;}
		#div3{width:50px;height:50px;border:1px solid #00ff00}
	</style>
</head>
<body>
	<div id="div1">
		<div id="div3"></div>
	</div>
	<div id="div2">
		bh.stopPropagation(event);阻止事件冒泡
	</div>
	<div>
		<a id="alink" href="http://www.163.com" >163</a>
	</div>
	<script type="text/javascript">
		var test1 = function(event){
			alert("div1");
		}
		var test2 = function(event){
			alert("div2");
			bh.stopPropagation(event);
		}
		var test3 = function(event){
			alert("div3");
		}
		var test = function(event){
			alert("div")
		}
		var testpreventDefault = function(event){
			bh.preventDefault(event);
			bh.stopPropagation(event);
		}
		bh.addEvent("click",bh("div1"),test1);
		bh.addEvent("click",bh("div2"),test2);
		bh.addEvent("click",bh("div3"),test3);
		bh.addEvent("click",bh("alink"),testpreventDefault);
		bh.addEvent("click",document,test);
		
	</script>
</body>
</html>